<%@taglib uri="/struts-tags" prefix="s"%>
<s:if test="#session.logged != 'true'">
	<jsp:forward page="../index.jsp" />
</s:if>
<script type="text/javascript" charset="utf-8">
	
	$(document).ready(function() {
		var tab = getURLParameter('tab');
		if (tab == "listTeam") {
			$("#details").removeClass('active');
			$("#team").addClass('active');

			$("#department-detail").removeClass('active');
			$("#list-team").addClass('active');
		}
		
		var save = getURLParameter('save');
		if (save == "successful") {							
			$.jGrowl("<h4 class='alert-heading'>Save Successfully</h4>", {theme : 'save-notification'});
		}
	});

	function getURLParameter(name) {
	    return decodeURI(
	        (RegExp(name + '=' + '(.+?)(&|$)').exec(location.search)||[,null])[1]
	    );
	}
</script>
<div class="container-fluid">
	<div class="content">
		<div class="row-fluid">
			<div class="span12">
			<form action="saveEditDepartment.action" method="POST" class='validate form-horizontal'>
				<div class="box">
				
					<!-- BreadCrumbs -->
					<div class="box-head "> 
						<jsp:include page="breadCrumbs.jsp" >
						<jsp:param value="2" name="bc"/>
						</jsp:include>
					</div>
				
					<!-- Box -->
					<div class="box-head tabs">
						<div style="width: 280px;">
							<h3>Department Detail</h3>
							<ul id="organisation-tab" class="nav nav-tabs"
								style="float: left; width: 280px">
								<li id ="details" class='active'><a href="#department-detail" data-toggle="tab">Details</a></li>
								<li id ="team" ><a href="#list-team" data-toggle="tab">Teams</a></li>
							</ul>
						</div>
						<div style="float: right;">
							<ul style="list-style: none;">
								<li style="float: left; margin-right: 10px;">
									<a id="mark-inactive" href="deActiveDepartment.action?idDepartment=<s:property value='departmentId'/>" class="btn btn-success">In-active</a>
								</li>
								
								<li style="float: left; margin-right: 10px;">
								<button type="submit" value="Save" id="save"
												class='btn btn-success pl_start btn-small '
												data-content="Some sample content ok"> Save</button> 	
								</li>
								<li style="float: left;">
									<a id="back-btn" href='editDirectorate.action?directorateId=<s:property value="directorateId"/>#tabList' class="btn btn-success">Back</a>
								</li>
							</ul>
						</div>
					</div>
					<div class="box-content" id="organisation">
						<div class="tab-content">
							<!--Tab 1: Department Detail  -->
							<div class="tab-pane active" id="department-detail">
								<%@ include file="detailDepartment.jsp" %>
							</div>
							<!--Tab 2: List Team  -->
							<div class="tab-pane" id="list-team">
								<%@ include file="listTeam.jsp" %>
							</div>
						</div>
					</div>
				</div>
				</form>
			</div>
		</div>
	</div>
</div>
	<!-- Type Business -->
	<div id="pageLookupBusinessType"> 
		<%@ include file="LookupBusinessType.jsp" %>
	</div>
	
	<!-- Contact -->

	<div id="pageLookUpContact"> 
		<%@ include file="lookUpContact.jsp" %>
	</div>
	
	<!-- Postcode -->
	<div id="pageLookupPostcode">
		<%@ include file="lookUpPostcode.jsp" %>
	</div>	